// ignore_for_file: implementation_imports

import 'package:pp_page/pp_page.dart';
import 'package:pp_uikit_demo/button/button_demo_page.dart';
import 'package:pp_uikit_demo/page_test/view.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'PPUIKit Demo Home Page'),
      initialRoute: '/',
      getPages: [
        GetPage(
          name: '/page/test',
          page: () => PageTestPage(),
        ),
      ],
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: ListView(
        padding: const EdgeInsets.all(10),
        children: <Widget>[
          ListTile(
            title: const Text("ButtonDemoPage"),
            onTap: () {
              Navigator.push(
                context,
                MaterialPageRoute(builder: (context) {
                  return ButtonDemoPage();
                }),
              );
            },
          ),
          ListTile(
            title: const Text("PageTestPage"),
            onTap: () {
              Get.toNamed("/page/test");
            },
          ),
        ],
      ),
    );
  }
}
